﻿using ProjectCloth.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
namespace ConsoleAppExport
{

    class Program
    {
        public static ClothContext db = new ClothContext();
        static void Main(string[] args)
        {
          var list=  GetSql();
        }
        static string GetSql()
        {
            var list = "";
            var lists = (from p in db.Products
                         join si in db.SaleOrderItems on p.Id equals si.ProductId
                         join s in db.SaleOrders on si.OrderId equals s.Id
                         select new
                         {
                             p.ProductNo,
                             //s.RecordDate,
                             
                             s.PayTime,
                             s.OrderNo,

                         }).ToList();
                       
            return list;
        }
    }
    public class SaleStatic
    {
        public string ProductNo { get; set; }
        public DateTime Date { get; set; }
        public string OrderNo { get; set; }
        public int Quantity { get; set; }
        public int Frequency { get; set; }

    }
}
